<?xml version="1.0" encoding="UTF-8" ?>
<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="com.cg.slms.domain.*,java.util.*"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%
	if (request.getAttribute("merchandise") == null) {
		Merchandise merchandise = new Merchandise();
		request.setAttribute("merchandise", merchandise);
	}
%>

<html>
<head>
<base href="<%=basePath%>" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>客户档案</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<script language="javascript" src="script/main.js"></script>
<script language="javascript">
	function deleteRecord(url) {
		if (window.confirm("确定要删除选中的记录吗？")) {
			window.location=url;
		}
	}
</script>
</head>
<body>

<form:form action="merchandiseAction" method="post" modelAttribute="merchandise" style="position:relative;top:60px;">
	<table border="0" cellpadding="1" cellspacing="1" width="95%">
		<tr>
			<td align="right" width="10%">商品编号</td>
			<td width="20%"><form:input path="code" class="form-control"></form:input></td>
			<td align="right" width="10%">商品名称</td>
			<td width="20%"><form:input path="name" class="form-control"></form:input></td>
			<td width="40%">&nbsp;</td>
		</tr>
		<tr>
			<td align="right" width="10%">&nbsp;</td>
			<td width="20%">&nbsp;</td>
			<td width="70%" colspan="5">&nbsp;</td>
		</tr>
	</table>

	<p></p>
	<div style="margin-left: 30px; margin-right: 0px">
	<table border="0" cellpadding="0" cellspacing="0" width="95%" style="position:relative;left:800px;top:-80px">
		<tr>
			<td width="5%"><input type="submit" value="查找"
				class="btn btn-info" /></td>
			<td width="10%"><input type="button" class="btn btn-info"
				value="新增" onclick="window.location.href('<%=basePath%>moduls/archive/addMerchandise.jsp')"></td>
			<!-- <td width="10%"><input type="button" onClick="" value="删除"
				class="BtnAction" /></td>
			<td width="10%"><input type="reset" value="重置" class="BtnAction" /></td>-->
			<td width="60%">&nbsp;</td> 
		</tr>
	</table>
	</div>

	<p></p>

	<div style="margin-left: 30px; margin-right: 0px">
	<table width="90%" border="0" cellpadding="0" cellspacing="0" class="table table-striped">
		<tr>
			<td width="2%" class="td_title">删除</td>
			<td width="2%" class="td_title">修改</td>
			<td width="10%" class="td_title">商品编号</td>
			<td width="15%" class="td_title">商品名称</td>
			<td width="15%" class="td_title">价格</td>
			
		</tr>
		<c:if test="${!empty requestScope.merchandises}">
			<c:forEach items="${requestScope.merchandises}" var="cli">
				<tr>
					<td class="td_border" align="center">
						<a href="javascript:deleteRecord('deleteMerchandiseByIdAction?id=${cli.id}')">
							<img src="image/wrong.gif" border="0"/>
						</a>
					</td>
					<td class="td_border" align="center">
						<a href="findMerchandiseByIdAction?id=${cli.id}">
							<img src="image/edit.gif" border="0"/>
						</a>
					</td>
					<td class="td_border">${cli.code}</td>
					<td class="td_border">${cli.name}</td>
					<td class="td_border">${cli.price}</td>
				</tr>
			</c:forEach>
		</c:if>
	</table>

	</div>
</form:form>
</body>
</html>